package com.naiterui.ehp.bs.recommend.remote;

import com.naiterui.ehp.bp.bo.esign.*;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author guoyongxiang
 * @date 2019/12/3 17:59
 * @since 1.0.0
 */
@FeignClient(name = "recommendEsign", url = "${ehp.domain.esign}", configuration = FeignConfiguration.class)
public interface IEsignFeignClient {

    /**
     * 医师处方预签
     *
     * @param recomPreSignVO
     *
     * @return
     */
    @PostMapping("inner/recom/preSign/dr")
    PreSignResultBO preSignDr(@RequestBody RecomSignParamBO recomPreSignVO) throws BusinessException;

    /**
     * 药师处方预签
     *
     * @param recomPreSignVO
     *
     * @return
     */
    @PostMapping("inner/recom/preSign/ph")
    PreSignResultBO preSignPh(@RequestBody RecomSignParamBO recomPreSignVO) throws BusinessException;


    /**
     * <pre>
     *     医师处方签名
     * </pre>
     *
     * @param recomPreSignVO
     */
    @PostMapping("inner/recom/sign/dr")
    void sign(RecomSignParamBO recomPreSignVO) throws BusinessException;

    /**
     * <pre>
     *     药师处方签名
     * </pre>
     *
     * @param recomPreSignVO
     */
    @PostMapping("inner/recom/sign/ph")
    void signPh(RecomSignParamBO recomPreSignVO) throws BusinessException;


    /**
     * <pre>
     *     医师签名账户信息
     * </pre>
     *
     * @param doctorId
     */
    @PostMapping("inner/dr/esign/info")
    EsignDoctorBO getDrEsignInfo(@RequestParam("doctorId") Long doctorId) throws BusinessException;

    /**
     * <pre>
     *     药师签名账户信息
     * </pre>
     *
     * @param pharmacistId
     */
    @PostMapping("inner/pharmacist/esign/info")
    EsignPharmacistBO getPhEsignInfo(@RequestParam("pharmacistId") Long pharmacistId) throws BusinessException;

    /**
     * 获取免签信息
     * @param doctorId 医生id
     * @return
     * @throws BusinessException
     */
    @GetMapping("/inner/dr/getNoSecretInfo")
    EsignNoSecretBO getNoSecretInfo(@RequestParam("doctorId") Long doctorId) throws BusinessException;

    /**
     * 获取免签信息
     * @param pharmacistId 药师id
     * @return
     * @throws BusinessException
     */
    @GetMapping("/inner/pharmacist/getNoSecretInfo")
    EsignNoSecretBO getPhNoSecretInfo(@RequestParam("pharmacistId") Long pharmacistId) throws BusinessException;
}
